{template /common/header}
<script type="text/javascript">
var obj_right="商家登陆";
var obj_rightlink="/index.php?m=user&c=public&a=logincompay";
</script>
<style type="text/css">
.app_login > input.Validform_error{ border:1px solid red;}
        	.errmsg{ color:red; text-align:center; line-height:24px; padding-top:5px;}
        </style>
<div class="divColor">
  <form action="{U('User/Api/login_wap')}" method="post" class="registerform" autocomplete="off">
    <input type="hidden" name="url_forward" value="{$_GET[url_forward]}"/>
    <input type="hidden" name="wechat_openid" value="{$_GET[wechat_openid]}"/>
    <div class="zhucefor errmsg" id="win"> </div>
    <div class="app_login">
      <input type="text" placeholder="请输入用户名或手机号" name="account"  id="username" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" datatype="*" errormsg="请输入用户名或手机号" nullmsg='请输入用户名或手机号'/>
      <p class="p1"></p>
    </div>
    <div class="app_login">
     <input type="password" placeholder="请输入登录密码"  autocomplete="off" name="password" id="password" datatype="*"  errormsg="请输入登录密码" nullmsg='请输入登录密码'/>
      <p class="p2"></p>
    </div>
    <div class="app_loginYZM">
     <input type="text" placeholder="请输入验证码" datatype="*"  name="userverify" id="userverify" errormsg="请输入验证码！" nullmsg='请输入验证码'/>
  <img src="<?php echo U('verify') ?>" id="verify" alt="看不清楚，换一张" style="cursor: pointer;"; onclick="this.src='<?php echo U('verify') ?>&_t=' + Math.round(new Date().getTime()/1000)" /></div>
    <a href="{U('repwd')}" class="app_pwThink">
    	忘记密码？
    </a>
    <div class="app_loginSub">
      <input type="submit"  value="个人登录" />
    </div>
    <div class="app_loginYZM"> <a class="a1" href="{U('user/public/reg')}">注册新用户</a> <!--a class="a2" href='{U('user/public/logincompay')}'>跳到商家登录</a--> </div>
  </form>
</div>
<script type="text/javascript">
function dosubmit() {
    $.post("{U('user/api/login_wap')}",{
        url_forward:$('input[name="url_forward"]').val(),
		wechat_openid:$('input[name="wechat_openid"]').val(),
		userverify:$('input[name="userverify"]').val(),
        account:$('input[name="account"]').val(),
        password:$('input[name="password"]').val(),
        cookie:$('input[name="cookie"]').val()
    },function(data) {
        if (data.status!=1) {   
			if(data.info!="登录超时，请刷新页面重新输入二级密码"){        
            	hd_alert(data.info);
			}
			 return false;
        } else {
		return true;		
		}
    },'JSON');
}
$(function() {
	$(".registerform").Validform({
		tiptype:function(msg,o,cssctl){
				if(o.type==1){
					o.obj.addClass("Validform_success")
				}
				if(o.type==3){
					o.obj.removeClass("Validform_success").addClass("Validform_error")
					$(".errmsg").text(msg).show();
					return false;
				}
			},
		ajaxPost: true,
		callback: function(ret) {
			if (ret.status == 0) {
				$('#error').css('display', 'block');
				$('.input_1').focus(function(){
					$('#error').css('display', 'none');
				});
				$('#error').html(ret.info);
			} else {
				location.href = "/index.php?m=user&c=index&a=index";
			}
		}
	});
})
$('#password').click(function() {
	$(this).val('');
});
setTitle('会员登录');

</script>
{template /common/footer}